|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.content.BroadcastReceiver
com.appventive.pausemediator.Mediator
public abstract class Mediator
Used by an app that wants to offer pause/resume control to other apps. For instance, this is used in the lock screen modes of both "ICE: In Case of Emergency" and "Executive Assistant" to allow other apps (mainly alarm clocks) to temporarily prevent the custom lock screen from coming up. When the alarm is going off, the lock screen is "paused", then when the alarm is dismissed, the lock screen is "resumed".
Field Summary | |
---|---|
static java.lang.String |
LabelExtra
the name of the app initiating the pause. |
static java.lang.String |
PackageExtra
the package initiating the pause. |
static java.lang.String |
Pause
Action to initiate the pause. |
static java.lang.String |
PauseGranted
Action send to a Requester to grant permission to pause. |
static java.lang.String |
PauseRequest
Action broadcast to request permission to pause. |
static java.lang.String |
Resume
Action to initiate a resume. |
static java.lang.String |
SecretExtra
the secret generated by the Mediator. |
Constructor Summary | |
---|---|
Mediator()
|
Method Summary | |
---|---|
int |
generateSecret()
|
static android.content.IntentFilter |
getIntentFilter()
|
abstract void |
handlePause(android.content.Context context,
java.lang.String pkg,
java.lang.String label)
This is what your app does when it gets "paused". |
abstract void |
handleResume(android.content.Context context)
This is what your app does when it gets "resumed" |
boolean |
hasPermissionToPause(android.content.Context context,
java.lang.String pkg)
Override this to conditionally grant or deny permission to specific packages |
void |
onReceive(android.content.Context context,
android.content.Intent intent)
|
boolean |
pauseEnabled(android.content.Context context)
Override this to conditionally enable or disable the PauseMediator as needed. |
Methods inherited from class android.content.BroadcastReceiver |
---|
abortBroadcast, clearAbortBroadcast, getAbortBroadcast, getDebugUnregister, getResultCode, getResultData, getResultExtras, isInitialStickyBroadcast, isOrderedBroadcast, peekService, setDebugUnregister, setOrderedHint, setResult, setResultCode, setResultData, setResultExtras |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String PauseRequest
public static final java.lang.String Pause
public static final java.lang.String Resume
public static final java.lang.String PauseGranted
public static final java.lang.String LabelExtra
public static final java.lang.String PackageExtra
public static final java.lang.String SecretExtra
Constructor Detail |
---|
public Mediator()
Method Detail |
---|
public static android.content.IntentFilter getIntentFilter()
public int generateSecret()
public void onReceive(android.content.Context context, android.content.Intent intent)
onReceive
in class android.content.BroadcastReceiver
public boolean pauseEnabled(android.content.Context context)
context
-
public boolean hasPermissionToPause(android.content.Context context, java.lang.String pkg)
context
- pkg
- the name of the package
public abstract void handlePause(android.content.Context context, java.lang.String pkg, java.lang.String label)
context
- pkg
- the name of the package that was granted the pause permissionlabel
- the application name of the package (e.g., as shown in a launcher shortcut)public abstract void handleResume(android.content.Context context)
context
-
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |